package com.github.grpc.client.property;

import com.google.common.collect.Maps;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;


@Data
@ConfigurationProperties("grpc")
public class GrpcChannelsProperties {

    /**
     * Register server to Etcd
     */
    private boolean register = true;

    /**
     * Path to SSL certificate cer
     */
    private String certificate;

    /**
     * is open SSL,Default to false.
     */
    private boolean tls = false;

    private boolean plaintext = true;

    /**
     * Setting to enable keepalive.
     * Default to {@code false}
     */
    private boolean enableKeepAlive = false;

    /**
     * Sets whether keepalive will be performed when there are no outstanding RPC on a connection.
     * Defaults to {@code false}.
     */
    private boolean keepAliveWithoutCalls = false;

    /**
     * The default delay in seconds before we send a keepalive.
     * Defaults to {@code 180}
     */
    private long keepAliveTime = 180;

    /**
     * The default timeout in seconds for a keepalive ping request.
     * Defaults to {@code 20}
     */
    private long keepAliveTimeout = 20;

    /**
     * The maximum message size allowed to be received on the channel.
     */
    private int maxInboundMessageSize;

    /**
     * SSL domain
     */
    private String domain;

    @NestedConfigurationProperty
    private GrpcChannelProperties client;

}
